<script type="text/javascript">
function enablepass(){
	var _pass = document.getElementById('txtPassword');	
	_pass.disabled = false;
};
</script>
<form id="frmTambahUser" method="post" action="<?php echo site_url('usermanagecontroller')?>">
<table width="55%" border="1">
	<tr style="background-color:#FFF; color:#000000;" align="center">
		<td colspan="3"><strong>Tambah/Edit User</strong></td>
	</tr>
	<tr>
		<td style="background-color:rgb(195,195,195);"><strong>UserId</strong></td>
		<td align="center"><strong>:</strong></td>
		<td><input type="text" id="txtUserId" name="txtUserId" <?php if(isset($users[0]->UserId)) echo 'value="'.$users[0]->UserId.'"'; else echo 'value=""';?>/></td>
	</tr>
	<tr>
		<td style="background-color:rgb(195,195,195);"><strong>Full Name</strong></td>
		<td align="center"><strong>:</strong></td>
		<td><input type="text" id="txtFullName" name="txtFullName" <?php if(isset($users[0]->Fullname)) echo 'value="'.$users[0]->Fullname.'"'; else echo 'value=""';?>/></td>
	</tr>
	<tr>
		<td style="background-color:rgb(195,195,195);"><strong>Password</strong></td>
		<td align="center"><strong>:</strong></td>
		<td><input type="password" id="txtPassword" name="txtPassword" <?php if(isset($users[0]->Password)) echo 'value="'.$users[0]->Password.'"'; else echo 'value=""';?>/></td>
	</tr>
	<tr>
		<td style="background-color:rgb(195,195,195);"><strong>System Grade</strong></td>
		<td align="center"><strong>:</strong></td>
		<td>
			<select id="grade" name="grade">
				<option value="-">Please Select</option>
			<?php if(isset($gradelist)) { if(count($gradelist) > 0) {?>
			<?php foreach ($gradelist as $grade){?>
				<option value="<?php echo $grade->gradeid?>"<?php if(isset($users[0]->GradeId)) { if(intval($users[0]->GradeId) == intval($grade->gradeid)) echo ' selected="selected" '; } ?>><?php echo $grade->description?></option>			
			<?php }}}?>
			</select>
		</td>
	</tr>	
</table><br/>
<input type="hidden" id="hdnaction" name="hdnaction" value="<?php if(isset($users[0]->UserId)) echo 'e'; else echo 'i';?>" />
<input type="submit" id="btnSimpanUser" name="tambahuser" value="Simpan User" />
<button onclick="javascript:window.location='<?php echo site_url('usermanagecontroller')?>'">Back</button>
</form>